/*
Navicat MySQL Data Transfer

Source Server         : projeto
Source Server Version : 50612
Source Host           : localhost:3306
Source Database       : naotebuk

Target Server Type    : MYSQL
Target Server Version : 50612
File Encoding         : 65001

Date: 2014-06-03 18:32:02
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `cliente`
-- ----------------------------
DROP TABLE IF EXISTS `cliente`;
CREATE TABLE `cliente` (
`idCliente`  int(11) NOT NULL AUTO_INCREMENT ,
`nome`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`cpf`  varchar(14) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`dt_nasc`  date NOT NULL ,
`sexo`  varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`endereco`  varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`email`  varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
PRIMARY KEY (`idCliente`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=3

;

-- ----------------------------
-- Records of cliente
-- ----------------------------
BEGIN;
INSERT INTO `cliente` VALUES ('1', 'amanda', '087.778.790.00', '2000-05-29', 'Feminino', 'rua bonita', 'amanda@gmail.com'), ('2', 'maria bonita', '899.890.980-80', '1789-03-22', 'Feminino', 'rua feia', 'mar@gmail.com');
COMMIT;

-- ----------------------------
-- Table structure for `conserto`
-- ----------------------------
DROP TABLE IF EXISTS `conserto`;
CREATE TABLE `conserto` (
`idConserto`  int(11) NOT NULL AUTO_INCREMENT ,
`dt_conserto`  date NULL DEFAULT NULL ,
`observacao`  varchar(10000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`idPedido`  int(11) NULL DEFAULT NULL ,
`status`  varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
PRIMARY KEY (`idConserto`),
FOREIGN KEY (`idPedido`) REFERENCES `pedido` (`idPedido`) ON DELETE CASCADE ON UPDATE CASCADE
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=6

;

-- ----------------------------
-- Records of conserto
-- ----------------------------
BEGIN;
INSERT INTO `conserto` VALUES ('4', '3914-06-03', 'cadastrar', '1', 'retirar'), ('5', '3914-06-03', 'cadastrar', '8', 'retirar');
COMMIT;

-- ----------------------------
-- Table structure for `fabricante`
-- ----------------------------
DROP TABLE IF EXISTS `fabricante`;
CREATE TABLE `fabricante` (
`idFabricante`  int(11) NOT NULL AUTO_INCREMENT ,
`nome`  varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
PRIMARY KEY (`idFabricante`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=2

;

-- ----------------------------
-- Records of fabricante
-- ----------------------------
BEGIN;
INSERT INTO `fabricante` VALUES ('1', 'Samsung');
COMMIT;

-- ----------------------------
-- Table structure for `pedido`
-- ----------------------------
DROP TABLE IF EXISTS `pedido`;
CREATE TABLE `pedido` (
`idPedido`  int(11) NOT NULL AUTO_INCREMENT ,
`idFabricante`  int(11) NOT NULL ,
`tipo_prod`  varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`modelo`  varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`desc_prob`  varchar(10000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`dt_entrada`  date NOT NULL ,
`dt_prevista`  date NOT NULL ,
`valor`  double NOT NULL ,
`status`  varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`idCliente`  int(11) NOT NULL ,
PRIMARY KEY (`idPedido`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=10

;

-- ----------------------------
-- Records of pedido
-- ----------------------------
BEGIN;
INSERT INTO `pedido` VALUES ('1', '1', 'note', 'note', 'note', '2014-05-29', '2014-06-03', '100', 'finalizar', '1'), ('2', '1', 'note', 'note', 'note', '2014-05-30', '2014-06-05', '100', 'aberto', '1'), ('3', '1', 'Notebook', 'AR2000', 'prolema na usb', '2014-05-31', '2014-06-10', '100', 'aberto', '1'), ('8', '0', 'Notebook', 'SA3', 'blblabla', '2014-05-27', '2014-06-01', '100', 'finalizar', '1'), ('9', '0', 'Desktop', 'RZ12', 'BLABLALBLA', '2014-01-20', '2014-01-04', '100', 'aberto', '2');
COMMIT;

-- ----------------------------
-- Table structure for `usuario`
-- ----------------------------
DROP TABLE IF EXISTS `usuario`;
CREATE TABLE `usuario` (
`idUsuario`  int(11) NOT NULL AUTO_INCREMENT ,
`nome`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`cargo`  varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`num_mat`  varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`email`  varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`senha`  varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`login`  varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
PRIMARY KEY (`idUsuario`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=4

;

-- ----------------------------
-- Records of usuario
-- ----------------------------
BEGIN;
INSERT INTO `usuario` VALUES ('1', 'rafael', 'gerente', '1', 'rafael_kozar@hotmail.com', '123', 'rafael'), ('2', 'loko', 'tecnico', '2', 'loko@gmail.com', '123', 'loko'), ('3', 'Isabele', 'tecnico', '3030', 'ilsabele@gmail.com', '123', 'isa');
COMMIT;

-- ----------------------------
-- Indexes structure for table cliente
-- ----------------------------
CREATE UNIQUE INDEX `cpf_UNIQUE` ON `cliente`(`cpf`) USING BTREE ;

-- ----------------------------
-- Auto increment value for `cliente`
-- ----------------------------
ALTER TABLE `cliente` AUTO_INCREMENT=3;

-- ----------------------------
-- Indexes structure for table conserto
-- ----------------------------
CREATE INDEX `idPedido` ON `conserto`(`idPedido`) USING BTREE ;

-- ----------------------------
-- Auto increment value for `conserto`
-- ----------------------------
ALTER TABLE `conserto` AUTO_INCREMENT=6;

-- ----------------------------
-- Auto increment value for `fabricante`
-- ----------------------------
ALTER TABLE `fabricante` AUTO_INCREMENT=2;

-- ----------------------------
-- Auto increment value for `pedido`
-- ----------------------------
ALTER TABLE `pedido` AUTO_INCREMENT=10;

-- ----------------------------
-- Indexes structure for table usuario
-- ----------------------------
CREATE UNIQUE INDEX `num_mat_UNIQUE` ON `usuario`(`num_mat`) USING BTREE ;
CREATE UNIQUE INDEX `login_UNIQUE` ON `usuario`(`login`) USING BTREE ;

-- ----------------------------
-- Auto increment value for `usuario`
-- ----------------------------
ALTER TABLE `usuario` AUTO_INCREMENT=4;
